]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/icon: Fix GIcon leak in set_fallback_icon_name
authorSebastian Keller <skeller@gnome.org>
Wed, 22 Jan 2020 22:34:23 +0000 (23:34 +0100)
committerSebastian Keller <skeller@gnome.org>
Wed, 22 Jan 2020 22:34:23 +0000 (23:34 +0100)
set_fallback_icon_name() leaks a GIcon by using the set_icon method
which adds a ref to the GIcon without removing its own ref after calling
the method.

Related to https://gitlab.gnome.org/GNOME/gnome-shell/issues/2146

src/st/st-icon.c

index 70e4fb46cfba0c29b71d65f3abcdf0af419ffd18..090ba4b10d3d4f15cdcdec2125de9b4281780599 100644 (file)
@@ -726,7 +726,7 @@ void
 st_icon_set_fallback_icon_name (StIcon      *icon,
                                 const gchar *fallback_icon_name)
 {
-  GIcon *gicon = NULL;
+  g_autoptr(GIcon) gicon = NULL;
 
   g_return_if_fail (ST_IS_ICON (icon));